package com.platform.server.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.platform.server.dao.ExpendDao;
import com.platform.server.service.ExpendService;

@Service
public class ExpendServiceImpl implements ExpendService {

	@Autowired
	private ExpendDao expendDao;
	
	/**
	 * 支出统计
	 */
	@Override
	public List<Map<String, Object>> selectExpendList(String startTime,String endTime,String mobile,String integral_rank) {
		Map<String,Object> map = new HashMap<String,Object>();
		map.put("startTime", startTime);
		map.put("endTime", endTime);
		map.put("integral_rank", integral_rank);
		map.put("mobile", mobile);
		return expendDao.selectExpendList(map);
	}

	/**
	 * 收入统计
	 */
	@Override
	public List<Map<String, Object>> selectIncomeList(String startTime,String endTime,String mobile,String integral_rank) {
		Map<String,Object> map = new HashMap<String,Object>();
		map.put("startTime", startTime);
		map.put("endTime", endTime);
		map.put("integral_rank", integral_rank);
		map.put("mobile", mobile);
		return expendDao.selectIncomeList(map);
	}

	//充值订单
	@Override
	public List<Map<String, Object>> selectRechargeOrder(String mobile,String integral_rank) {
		Map<String,Object> map = new HashMap<String,Object>();
		map.put("integral_rank", integral_rank);
		map.put("mobile", mobile);
		return expendDao.selectRechargeOrder(map);
	}

	//已取消订单
	@Override
	public List<Map<String, Object>> selectCancelOrder(String mobile,String integral_rank,String type) {
		Map<String,Object> map = new HashMap<String,Object>();
		map.put("integral_rank", integral_rank);
		map.put("mobile", mobile);
		map.put("type", type);
		return expendDao.selectCancelOrder(map);
	}

	//提现不通过订单
	@Override
	public List<Map<String, Object>> selectWithdrawNopass(String mobile,String integral_rank) {
		Map<String,Object> map = new HashMap<String,Object>();
		map.put("integral_rank", integral_rank);
		map.put("mobile", mobile);
		return expendDao.selectWithdrawNopass(map);
	}

	/**
	 * 查看VIP统计
	 */
	@Override
	public List<Map<String, Object>> qureyVipList(String startTime,
			String endTime, String orderId, String mobile, String type) {
		Map<String,Object> map = new HashMap<String,Object>();
		map.put("startTime", startTime);
		map.put("endTime", endTime);
		map.put("orderId", orderId);
		map.put("mobile", mobile);
		map.put("type", type);
		return expendDao.qureyVipList(map);
	}

	/**
	 * 收入统计
	 */
	@Override
	public List<Map<String, Object>> queryIncomeList(String startTime,
			String endTime, String orderId,String serverName, String mobile, String type, String serveraddres, String userType, String serverType) {
		Map<String,Object> map = new HashMap<String,Object>();
		map.put("startTime", startTime);
		map.put("endTime", endTime);
		map.put("orderId", orderId);
		map.put("mobile", mobile);
		map.put("type", type);
		map.put("serveraddres", serveraddres);
		map.put("userType", userType);
		map.put("serverType", serverType);
		map.put("serverName", serverName);
		return expendDao.queryIncomeList(map);
	}

	/**
	 * 查看充值订单
	 */
	@Override
	public List<Map<String, Object>> queryRechargeOrderList(String startTime,
			String endTime, String orderId, String mobile, String type) {
		Map<String,Object> map = new HashMap<String,Object>();
		map.put("startTime", startTime);
		map.put("endTime", endTime);
		map.put("orderId", orderId);
		map.put("mobile", mobile);
		map.put("type", type);
		return expendDao.queryRechargeOrderList(map);
	}

	/**
	 * 查看提现通过订单 
	 */
	@Override
	public List<Map<String, Object>> queryWithdrawList(String startTime,
			String endTime, String orderId, String mobile, String type) {
		Map<String,Object> map = new HashMap<String,Object>();
		map.put("startTime", startTime);
		map.put("endTime", endTime);
		map.put("orderId", orderId);
		map.put("mobile", mobile);
		map.put("type", type);
		return expendDao.queryWithdrawList(map);
	}

}
